(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 12.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     32487,        892]
NotebookOptionsPosition[     31343,        867]
NotebookOutlinePosition[     31731,        884]
CellTagsIndexPosition[     31688,        881]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "\"\<Global`*\>\"", "]"}], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "\:76ee\:6807", ":", 
     "\:8f93\:5165\:4e00\:4e2a\:7c7b\:65f6\:5f52\:4e00\:77e2\:91cf"}], 
    "\:ff1a", 
    RowBox[{"X", "=", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"x1", ",", "x2", ",", "x3", ",", "x4"}], "}"}], " ", 
      "\:8f93\:51fa\:5c06", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"+", 
         RowBox[{"/", 
          RowBox[{"-", "1"}]}]}], ",", "0", ",", "0", ",", "0"}], "}"}], 
      "\:53d8\:4e3aX\:7684\:6d1b\:4f26\:8328\:53d8\:6362\:7684\:76f8\:5e94\
\:53c2\:6570"}]}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"\:8981\:6c42", ":", "1"}], ")"}], " ", 
     "\:4e3b\:51fd\:6570ELorentz4D\:53ef\:4ee5\:53e6\:5b58\:7a0b\:5e8f\:5305",
      " ", 
     RowBox[{"Lorentzian", ".", "wdx"}]}], "\:ff0c", 
    "\:53ef\:4ee5\:5355\:72ec\:4e8e\:5176\:4ed6\:7a0b\:5e8f\:8fd0\:884c"}], 
   "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"--", 
    RowBox[{"--", 
     RowBox[{"--", 
      RowBox[{"--", 
       RowBox[{"--", 
        RowBox[{"--", 
         RowBox[{"--", 
          RowBox[{"--", 
           RowBox[{"--", 
            RowBox[{"--", 
             RowBox[{"--", 
              RowBox[{"--", 
               RowBox[{"--", 
                RowBox[{"--", 
                 RowBox[{"--", 
                  RowBox[{"--", 
                   RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{
                    "--", "--"}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]\
}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"\:8f85\:52a9\:51fd\:65701", "\:ff1a", " ", 
    RowBox[{"\:95f5\:6c0f\:957f\:5ea6", " ", "LNorm", "  ", "\:8f93\:5165"}], 
    "\:ff1a", 
    RowBox[{"X", "=", 
     RowBox[{"{", 
      RowBox[{"x1", ",", "x2", ",", "x3", ",", "x4"}], "}"}]}], "\:ff0c", 
    "\:8f93\:51fa", "\:ff1a", 
    RowBox[{"\:5b9e\:6570\:95f5\:6c0f\:8ddd\:79bb", " ", "\:4f9d\:8d56"}], 
    "\:ff1a", "\:65e0"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"\:8f85\:52a9\:51fd\:65702", "\:ff1a", " ", 
    RowBox[{
    "\:95f5\:6c0f\:957f\:5ea6\:5e73\:65b9", " ", "LNorm2", "  ", 
     "\:8f93\:5165"}], "\:ff1a", 
    RowBox[{"X", "=", 
     RowBox[{"{", 
      RowBox[{"x1", ",", "x2", ",", "x3", ",", "x4"}], "}"}]}], "\:ff0c", " ",
     "\:8f93\:51fa", "\:ff1a", " ", 
    RowBox[{
    "\:95f5\:6c0f\:957f\:5ea6\:5e73\:65b9", " ", 
     "\:6b63\:6570\:4e3a\:7c7b\:7a7a", " ", "0", "\:4e3a\:7c7b\:5149", " ", 
     "\:8d1f\:6570\:4e3a\:7c7b\:65f6", " ", "\:4f9d\:8d56"}], "\:ff1a", 
    "\:65e0"}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"\:8f85\:52a9\:51fd\:65703", "\:ff1a", " ", 
    RowBox[{"\:6b27\:5f0f\:65cb\:8f6c\:77e9\:9635", "  ", 
     RowBox[{"Rotation3L", "[", "x_", "]"}], " ", "\:8f93\:5165"}], "\:ff1a", 
    RowBox[{"X", "=", 
     RowBox[{"{", 
      RowBox[{"x1", ",", "x2", ",", "x3", ",", "x4"}], "}"}]}], "\:ff0c", 
    "\:8f93\:51fa", "\:ff1a", 
    RowBox[{
     RowBox[{"\:5c06\:7a7a\:95f4\:5206\:91cf\:8f6c\:6362\:4e3a", " ", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", "z"}], "}"}], 
      "\:7684\:65cb\:8f6c\:77e9\:9635", " ", "\:5373", " ", 
      RowBox[{
       RowBox[{"Rotation3L", "[", "X", "]"}], ".", 
       RowBox[{"X", "[", 
        RowBox[{"[", 
         RowBox[{"2", ";;", "4"}], "]"}], "]"}]}]}], "=", " ", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", "z"}], "}"}], "\:4f9d\:8d56"}]}], "\:ff1a",
     "\:65e0"}], " ", "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"--", 
    RowBox[{"--", 
     RowBox[{"--", 
      RowBox[{"--", 
       RowBox[{"--", 
        RowBox[{"--", 
         RowBox[{"--", 
          RowBox[{"--", 
           RowBox[{"--", 
            RowBox[{"--", 
             RowBox[{"--", 
              RowBox[{"--", 
               RowBox[{"--", 
                RowBox[{"--", 
                 RowBox[{"--", 
                  RowBox[{"--", 
                   RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{"--", 
                    RowBox[{
                    "--", "--"}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]\
}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}], 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"\:4e3b\:8981\:6570\:636e\:63a5\:53e3", ":", " ", "1"}], ")"}], 
     " ", "\:7c7b\:65f6\:77e2\:91cf", " ", "X"}], "=", 
    RowBox[{"{", 
     RowBox[{"x1", ",", "x2", ",", "x3", ",", "x4"}], "}"}]}], 
   "*)"}]}]}], "Input",
 CellChangeTimes->{{3.8265336309981236`*^9, 3.826533673230311*^9}, 
   3.826533909837808*^9, {3.826534343056493*^9, 3.8265344399392366`*^9}, {
   3.8265345175320997`*^9, 3.826534567067391*^9}, {3.8265346393747764`*^9, 
   3.826534763076602*^9}, {3.8265347963305073`*^9, 3.8265349897428207`*^9}, {
   3.826535073363107*^9, 3.8265350995343018`*^9}, {3.826535176827162*^9, 
   3.826535182729402*^9}, {3.826535283202676*^9, 3.826535295185963*^9}},
 CellLabel->
  "In[1999]:=",ExpressionUUID->"92ed2f1f-f96f-4621-b354-885339e7b022"],

Cell[BoxData[
 RowBox[{
  RowBox[{"SetDirectory", "[", 
   RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}]], "Input",
 CellLabel->
  "In[2000]:=",ExpressionUUID->"67bf5be3-1074-40f1-a750-dc09bdecd627"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"tempfile16", "=", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"Directory", "[", "]"}], ",", "\"\<Lorentzian.wdx\>\""}], "}"}],
     "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"tempfile13", "=", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"Directory", "[", "]"}], ",", "\"\<vertice.wdx\>\""}], "}"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"tempfile14", "=", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"Directory", "[", "]"}], ",", "\"\<Deficient.wdx\>\""}], "}"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Get", "[", "tempfile13", "]"}], "\[IndentingNewLine]", 
 RowBox[{"Get", "[", "tempfile14", "]"}]}], "Input",
 CellChangeTimes->{{3.8265190106444335`*^9, 3.8265190435136147`*^9}, 
   3.826519096503748*^9, {3.8271302688314323`*^9, 3.8271302888136234`*^9}},
 CellLabel->
  "In[2001]:=",ExpressionUUID->"d586989c-c234-414f-b5dd-ff5ed5aa637a"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Rotation3L", "[", "x_", "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"u", ",", "v", ",", "RO"}], "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"u", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"x", "[", 
         RowBox[{"[", "a", "]"}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"a", ",", "2", ",", "4"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"v", "=", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0", ",", 
        RowBox[{"Norm", "[", "u", "]"}]}], "}"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Norm", "[", "u", "]"}], "\[Equal]", "0"}], ",", 
       RowBox[{"RO", "=", 
        RowBox[{"IdentityMatrix", "[", "3", "]"}]}], ",", 
       RowBox[{"RO", "=", 
        RowBox[{"RotationMatrix", "[", 
         RowBox[{"{", 
          RowBox[{"u", ",", "v"}], "}"}], "]"}]}]}], "]"}], ";", 
     "\[IndentingNewLine]", "RO"}]}], "\[IndentingNewLine]", "]"}]}]], "Input",
 CellChangeTimes->{{3.8265190753059072`*^9, 3.8265190927727213`*^9}},
 CellLabel->
  "In[2006]:=",ExpressionUUID->"9f007a70-0459-4b0f-a0e8-76acbcba93a2"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"ELorentz4D", "[", "x_", "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
     "RO", ",", "LA", ",", "VL", ",", "ZC", ",", "LM", ",", "RM", ",", "RA", 
      ",", "NN", ",", "FE", ",", "A", ",", "B", ",", "CC", ",", "CD"}], "}"}],
     ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"RO", "=", 
      RowBox[{"Rotation3L", "[", "x", "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"RA", "=", 
      RowBox[{"EulerAngles", "[", 
       RowBox[{"RO", ",", 
        RowBox[{"{", 
         RowBox[{"1", ",", "2", ",", "3"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"LA", "=", 
      RowBox[{"ArrayFlatten", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "0"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"0", ",", "RO"}], "}"}]}], "}"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"VL", "=", 
      RowBox[{"LA", ".", "x"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"ZC", "=", 
      RowBox[{"ArcTanh", "[", 
       RowBox[{
        RowBox[{"VL", "[", 
         RowBox[{"[", "4", "]"}], "]"}], "/", 
        RowBox[{"VL", "[", 
         RowBox[{"[", "1", "]"}], "]"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"LM", "=", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{
          RowBox[{"Cosh", "[", "ZC", "]"}], ",", "0", ",", "0", ",", 
          RowBox[{"-", 
           RowBox[{"Sinh", "[", "ZC", "]"}]}]}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"-", 
           RowBox[{"Sinh", "[", "ZC", "]"}]}], ",", "0", ",", "0", ",", 
          RowBox[{"Cosh", "[", "ZC", "]"}]}], "}"}]}], "}"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"NN", "=", 
      RowBox[{"LM", ".", "VL"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"A", "=", 
      RowBox[{"MatrixExp", "[", 
       RowBox[{
        RowBox[{"-", "I"}], "*", "ZC", "*", 
        RowBox[{"(", 
         RowBox[{"I", "*", 
          RowBox[{
           RowBox[{"PauliMatrix", "[", "3", "]"}], "/", "2"}]}], ")"}]}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"B", "=", 
      RowBox[{
       RowBox[{"MatrixExp", "[", 
        RowBox[{"I", "*", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"RA", "[", 
            RowBox[{"[", "3", "]"}], "]"}], "*", 
           RowBox[{
            RowBox[{"PauliMatrix", "[", "3", "]"}], "/", "2"}]}], ")"}]}], 
        "]"}], ".", 
       RowBox[{"MatrixExp", "[", 
        RowBox[{"I", "*", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", 
            RowBox[{"RA", "[", 
             RowBox[{"[", "2", "]"}], "]"}]}], "*", 
           RowBox[{
            RowBox[{"PauliMatrix", "[", "2", "]"}], "/", "2"}]}], ")"}]}], 
        "]"}], ".", 
       RowBox[{"MatrixExp", "[", 
        RowBox[{"I", "*", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"-", 
            RowBox[{"RA", "[", 
             RowBox[{"[", "1", "]"}], "]"}]}], "*", 
           RowBox[{
            RowBox[{"PauliMatrix", "[", "1", "]"}], "/", "2"}]}], ")"}]}], 
        "]"}]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"CC", "=", 
      RowBox[{
       RowBox[{"Inverse", "[", "LA", "]"}], ".", 
       RowBox[{"Inverse", "[", "LM", "]"}]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"CD", "=", 
      RowBox[{
       RowBox[{"Inverse", "[", "B", "]"}], ".", 
       RowBox[{"Inverse", "[", "A", "]"}]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "ZC", ",", "RA", ",", "LM", ",", "RO", ",", "LA", ",", "NN", ",", "CC", 
       ",", "CD"}], "}"}]}]}], 
   RowBox[{"(*", 
    RowBox[{
     RowBox[{
      RowBox[{"Input", " ", "vector", " ", "must", " ", "be", " ", "time"}], 
      "-", 
      RowBox[{
       RowBox[{"like", "!"}], " ", "1.", "ZC", " ", "is", " ", "dihedral", 
       " ", "angle"}]}], ",", 
     RowBox[{"2.", "RA", " ", "is", " ", "the", " ", "Eulerangle", 
      RowBox[{"(", 
       RowBox[{"1", ",", "2", ",", "3"}], ")"}]}], ",", 
     RowBox[{
     "3.", " ", "LM", " ", "is", " ", "the", " ", "Lorentz", " ", 
      "transformation"}], ",", 
     RowBox[{
     "4.", "Ro", " ", "is", " ", "the", " ", "3", "d", " ", "rotation", " ", 
      "matrix"}], ",", 
     RowBox[{
     "6.", "NN", " ", "indicates", " ", "the", " ", "4", "D", " ", 
      "orientation"}], ",", 
     RowBox[{
     "7.", "CC", " ", "is", " ", "the", " ", "Lorentz", " ", "matrix", "*"}], 
     ",", 
     RowBox[{
     "8.", "CD", " ", "is", " ", "the", " ", "spinor", " ", "rep", " ", "of", 
      " ", "Lorentz", " ", "transformation"}]}], " ", "*)"}], 
   "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"AELorentz4D", "[", "x_", "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"tt", ",", "res"}], "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tt", "=", 
      RowBox[{
       RowBox[{
        RowBox[{"ELorentz4D", "[", "x", "]"}], "[", 
        RowBox[{"[", "7", "]"}], "]"}], ".", 
       RowBox[{"{", 
        RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}]}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"tt", "[", 
          RowBox[{"[", "1", "]"}], "]"}], "-", 
         RowBox[{"x", "[", 
          RowBox[{"[", "1", "]"}], "]"}]}], "<", 
        RowBox[{"10", "^", 
         RowBox[{"-", "11"}]}]}], ",", "\[IndentingNewLine]", 
       RowBox[{"res", "=", 
        RowBox[{"ELorentz4D", "[", "x", "]"}]}], ",", "\[IndentingNewLine]", 
       RowBox[{"res", "=", 
        RowBox[{"ELorentz4D", "[", 
         RowBox[{"-", "x"}], "]"}]}]}], "\[IndentingNewLine]", "]"}], ";", 
     "\[IndentingNewLine]", "res"}]}], "\[IndentingNewLine]", 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"BELorentz4D", "[", 
   RowBox[{"y_", ",", "x_"}], "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", "res", "}"}], ",", "\[IndentingNewLine]", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"y", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", 
       RowBox[{"res", "=", 
        RowBox[{"ELorentz4D", "[", "x", "]"}]}], ",", "\[IndentingNewLine]", 
       RowBox[{"res", "=", 
        RowBox[{"ELorentz4D", "[", 
         RowBox[{"-", "x"}], "]"}]}]}], "\[IndentingNewLine]", "]"}], ";", 
     "\[IndentingNewLine]", "res"}]}], "\[IndentingNewLine]", 
   "]"}]}]}], "Input",
 CellChangeTimes->{{3.826519146400129*^9, 3.826519146476919*^9}, {
  3.8265334809279585`*^9, 3.8265335050968122`*^9}, {3.8277077085044956`*^9, 
  3.8277078678111277`*^9}, {3.827750692862398*^9, 3.8277507306891174`*^9}},
 CellLabel->
  "In[2007]:=",ExpressionUUID->"9de548ad-a7ec-4fc9-82a8-d0d97ba8c7b1"],

Cell[BoxData[
 RowBox[{
  RowBox[{"EFace3D", "[", 
   RowBox[{"vid_", ",", "sid_", ",", "tid_", ",", "fid_", ",", "Vertex_"}], 
   "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
     "a", ",", "b", ",", "c", ",", "vv", ",", "c1", ",", "c2", ",", "c3", ",",
       "c4", ",", "v"}], "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vv", "=", 
      RowBox[{"Vertex", "[", 
       RowBox[{"[", 
        RowBox[{
         RowBox[{"Position", "[", 
          RowBox[{"Sid", ",", "sid"}], "]"}], "[", 
         RowBox[{"[", 
          RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"a", "=", 
      RowBox[{"vid", "/.", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"sid", "\[Rule]", "Nothing"}], ",", 
         RowBox[{"tid", "\[Rule]", "Nothing"}]}], "}"}]}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"b", "=", 
      RowBox[{"Sort", "[", 
       RowBox[{"vid", "/.", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"sid", "\[Rule]", "Nothing"}], ",", 
          RowBox[{"tid", "\[Rule]", "Nothing"}], ",", 
          RowBox[{"fid", "\[Rule]", "Nothing"}]}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"c", "=", 
      RowBox[{"ELorentz4D", "[", 
       RowBox[{"FDNormal", "[", 
        RowBox[{"vid", ",", "vv", ",", "sid", ",", "tid"}], "]"}], "]"}]}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"v", "=", 
      RowBox[{"Map", "[", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"Inverse", "[", 
           RowBox[{"c", "[", 
            RowBox[{"[", "7", "]"}], "]"}], "]"}], ".", 
          RowBox[{"vv", "[", 
           RowBox[{"[", 
            RowBox[{
             RowBox[{"Position", "[", 
              RowBox[{"vid", ",", "#"}], "]"}], "[", 
             RowBox[{"[", 
              RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}], "&"}], 
        ",", "a"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"c4", "=", 
      RowBox[{
       RowBox[{
        RowBox[{"Total", "[", "v", "]"}], "/", "4"}], "-", 
       RowBox[{
        RowBox[{"Inverse", "[", 
         RowBox[{"c", "[", 
          RowBox[{"[", "7", "]"}], "]"}], "]"}], ".", 
        RowBox[{"vv", "[", 
         RowBox[{"[", 
          RowBox[{
           RowBox[{"Position", "[", 
            RowBox[{"vid", ",", 
             RowBox[{"b", "[", 
              RowBox[{"[", "3", "]"}], "]"}]}], "]"}], "[", 
           RowBox[{"[", 
            RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}]}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"c1", "=", 
      RowBox[{
       RowBox[{"Inverse", "[", 
        RowBox[{"c", "[", 
         RowBox[{"[", "7", "]"}], "]"}], "]"}], ".", 
       RowBox[{"MVvertor", "[", 
        RowBox[{"vv", ",", 
         RowBox[{"b", "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", 
         RowBox[{"b", "[", 
          RowBox[{"[", "3", "]"}], "]"}]}], "]"}]}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"c2", "=", 
      RowBox[{
       RowBox[{"Inverse", "[", 
        RowBox[{"c", "[", 
         RowBox[{"[", "7", "]"}], "]"}], "]"}], ".", 
       RowBox[{"MVvertor", "[", 
        RowBox[{"vv", ",", 
         RowBox[{"b", "[", 
          RowBox[{"[", "2", "]"}], "]"}], ",", 
         RowBox[{"b", "[", 
          RowBox[{"[", "3", "]"}], "]"}]}], "]"}]}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"c3", "=", 
      RowBox[{"Cross", "[", 
       RowBox[{
        RowBox[{"c1", "[", 
         RowBox[{"[", 
          RowBox[{"2", ";;", "4"}], "]"}], "]"}], ",", 
        RowBox[{"c2", "[", 
         RowBox[{"[", 
          RowBox[{"2", ";;", "4"}], "]"}], "]"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"-", "1"}], ")"}], "^", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"HeavisideTheta", "[", 
          RowBox[{
           RowBox[{"c4", "[", 
            RowBox[{"[", 
             RowBox[{"2", ";;", "4"}], "]"}], "]"}], ".", "c3"}], "]"}], "+", 
         "1"}], ")"}]}], "*", "c3"}]}]}], "\[IndentingNewLine]", 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.827130662602928*^9, 3.8271306658471794`*^9}, 
   3.8271326847016587`*^9},
 CellLabel->
  "In[2010]:=",ExpressionUUID->"fbba3e60-f6f5-4d4b-b0cb-fc4ccf41e556"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"LNorm2", "[", "x_", "]"}], ":=", 
  RowBox[{
   RowBox[{"-", 
    RowBox[{
     RowBox[{"x", "[", 
      RowBox[{"[", "1", "]"}], "]"}], "^", "2"}]}], "+", 
   RowBox[{
    RowBox[{"Norm", "[", 
     RowBox[{"x", "[", 
      RowBox[{"[", 
       RowBox[{"2", ";;", "4"}], "]"}], "]"}], "]"}], "^", 
    "2"}]}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LNorm", "[", "x_", "]"}], ":=", 
  RowBox[{"Sqrt", "[", 
   RowBox[{"Abs", "[", 
    RowBox[{
     RowBox[{"-", 
      RowBox[{
       RowBox[{"x", "[", 
        RowBox[{"[", "1", "]"}], "]"}], "^", "2"}]}], "+", 
     RowBox[{
      RowBox[{"Norm", "[", 
       RowBox[{"x", "[", 
        RowBox[{"[", 
         RowBox[{"2", ";;", "4"}], "]"}], "]"}], "]"}], "^", "2"}]}], "]"}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"sps", "[", "x_", "]"}], ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"ss", "=", 
       RowBox[{"Chop", "[", 
        RowBox[{"x", "/", 
         RowBox[{"Norm", "[", "x", "]"}]}], "]"}]}], ",", "Sc"}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"ss", "==", 
        RowBox[{"{", 
         RowBox[{"0", ",", "0", ",", 
          RowBox[{"-", "1"}]}], "}"}]}], ",", 
       RowBox[{"Sc", "=", 
        RowBox[{"{", 
         RowBox[{"1", ",", "Pi", ",", "0"}], "}"}]}], ",", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"ss", "\[Equal]", 
          RowBox[{"{", 
           RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], ",", 
         RowBox[{"Sc", "=", 
          RowBox[{"{", 
           RowBox[{"1", ",", 
            RowBox[{"4", "*", "Pi"}], ",", "0"}], "}"}]}], ",", 
         RowBox[{"Sc", "=", 
          RowBox[{"ToSphericalCoordinates", "[", "ss", "]"}]}]}], "]"}]}], 
      "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Cos", "[", 
        FractionBox[
         RowBox[{"Sc", "[", 
          RowBox[{"[", "2", "]"}], "]"}], "2"], "]"}], " ", ",", 
       RowBox[{
        RowBox[{"Sin", "[", 
         FractionBox[
          RowBox[{"Sc", "[", 
           RowBox[{"[", "2", "]"}], "]"}], "2"], "]"}], 
        SuperscriptBox["\[ExponentialE]", 
         RowBox[{"\[ImaginaryI]", " ", 
          RowBox[{"Sc", "[", 
           RowBox[{"[", "3", "]"}], "]"}]}]]}]}], "}"}]}]}], 
   "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Bivector", "[", 
   RowBox[{"vid_", ",", "vv_", ",", "sid_", ",", "tid_", ",", "fid_"}], "]"}],
   ":=", 
  RowBox[{"Block", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"ge", "=", 
       RowBox[{"DiagonalMatrix", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"-", "1"}], ",", "1", ",", "1", ",", "1"}], "}"}], "]"}]}], 
      ",", "vv1", ",", "te1", ",", "kk", ",", "inv", ",", "zz", ",", "Sid"}], 
     "}"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"Sid", "=", 
      RowBox[{"{", 
       RowBox[{"6", ",", "4", ",", "2"}], "}"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"inv", "=", 
      RowBox[{"vv", "[", 
       RowBox[{"[", 
        RowBox[{
         RowBox[{"Position", "[", 
          RowBox[{"Sid", ",", "sid"}], "]"}], "[", 
         RowBox[{"[", 
          RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"vv1", "=", 
      RowBox[{"vid", "/.", 
       RowBox[{"sid", "\[Rule]", "Nothing"}]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"te1", "=", 
      RowBox[{"Sort", "[", 
       RowBox[{"vv1", "/.", 
        RowBox[{"tid", "\[Rule]", "Nothing"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"kk", "=", 
      RowBox[{"Map", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"{", 
          RowBox[{
           RowBox[{
            RowBox[{"inv", "[", 
             RowBox[{"[", 
              RowBox[{
               RowBox[{"Position", "[", 
                RowBox[{"vid", ",", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}]}], "]"}], "[", 
               RowBox[{"[", 
                RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}], "-", 
            RowBox[{"inv", "[", 
             RowBox[{"[", 
              RowBox[{
               RowBox[{"Position", "[", 
                RowBox[{"vid", ",", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "2", "]"}], "]"}]}], "]"}], "[", 
               RowBox[{"[", 
                RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}], ",", 
           RowBox[{
            RowBox[{"inv", "[", 
             RowBox[{"[", 
              RowBox[{
               RowBox[{"Position", "[", 
                RowBox[{"vid", ",", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "3", "]"}], "]"}]}], "]"}], "[", 
               RowBox[{"[", 
                RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}], "-", 
            RowBox[{"inv", "[", 
             RowBox[{"[", 
              RowBox[{
               RowBox[{"Position", "[", 
                RowBox[{"vid", ",", 
                 RowBox[{"#", "[", 
                  RowBox[{"[", "1", "]"}], "]"}]}], "]"}], "[", 
               RowBox[{"[", 
                RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}]}], 
          "}"}], "&"}], ",", 
        RowBox[{"{", 
         RowBox[{"te1", "/.", 
          RowBox[{"fid", "\[Rule]", "Nothing"}]}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"zz", "=", 
      RowBox[{"Map", "[", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"LeviCivitaTensor", "[", "4", "]"}], ".", 
          RowBox[{"(", 
           RowBox[{"ge", ".", 
            RowBox[{"#", "[", 
             RowBox[{"[", "2", "]"}], "]"}]}], ")"}], ".", 
          RowBox[{"(", 
           RowBox[{"ge", ".", 
            RowBox[{"#", "[", 
             RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "&"}], ",", "kk"}], 
       "]"}]}], ";", "\[IndentingNewLine]", "zz"}]}], 
   RowBox[{"(*", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"-", "1"}], ")"}], "^", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{
        RowBox[{"Position", "[", 
         RowBox[{"te1", ",", "fid"}], "]"}], "[", 
        RowBox[{"[", 
         RowBox[{"1", ",", "1"}], "]"}], "]"}], "+", "1"}], ")"}]}], "*)"}], 
   "\[IndentingNewLine]", "]"}]}]}], "Input",
 CellChangeTimes->{{3.826532607837745*^9, 3.8265326158827553`*^9}, {
   3.826532690125939*^9, 3.8265326970429277`*^9}, {3.8265327326862335`*^9, 
   3.826532825615735*^9}, {3.826533177456767*^9, 3.826533191359536*^9}, {
   3.826533535335741*^9, 3.8265335604450464`*^9}, {3.827055144790581*^9, 
   3.8270551656600685`*^9}, 3.8271110804716883`*^9, {3.8271336990167403`*^9, 
   3.8271337041213756`*^9}, {3.8272881454785705`*^9, 
   3.8272881478502245`*^9}, {3.8274046757942677`*^9, 
   3.8274046768676796`*^9}, {3.8274049304574766`*^9, 3.82740493996803*^9}, {
   3.827404981882606*^9, 3.8274050164903746`*^9}, {3.8274050768907876`*^9, 
   3.827405099149434*^9}, 3.8274051486330175`*^9, {3.8274052487995014`*^9, 
   3.827405249323387*^9}, {3.8274052865316305`*^9, 3.8274053337826705`*^9}, {
   3.8274057433131294`*^9, 3.8274057737638974`*^9}, {3.82740680864138*^9, 
   3.827406916386942*^9}, {3.8274069944413967`*^9, 3.827406996468935*^9}, {
   3.827407059884219*^9, 3.8274070606887913`*^9}, 3.8274096829912767`*^9, {
   3.827490517804902*^9, 3.827490523039601*^9}, {3.833627161346368*^9, 
   3.8336271659553585`*^9}},
 CellLabel->
  "In[709]:=",ExpressionUUID->"d66750fd-297b-4203-826b-a7ab928130d5"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"DumpSave", "[", 
  RowBox[{"tempfile16", ",", 
   RowBox[{"{", 
    RowBox[{
    "Rotation3L", ",", "ELorentz4D", ",", "AELorentz4D", ",", "BELorentz4D", 
     ",", "LNorm", ",", "LNorm2", ",", "EFace3D", ",", "sps", ",", 
     "Bivector"}], "}"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.826535106230034*^9, 3.8265351490985584`*^9}, {
  3.826535319771884*^9, 3.8265353273459477`*^9}, {3.826535438401474*^9, 
  3.8265354438835382`*^9}, {3.827130294663518*^9, 3.8271303036406155`*^9}, {
  3.827288154936129*^9, 3.8272881555704317`*^9}, {3.827404682118617*^9, 
  3.8274046872844906`*^9}, {3.8277078776269164`*^9, 3.827707882097008*^9}, {
  3.8277507402443256`*^9, 3.8277507431995096`*^9}},
 CellLabel->
  "In[713]:=",ExpressionUUID->"d867a175-059e-44a3-9e3f-f47df7663b6b"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "Rotation3L", ",", "ELorentz4D", ",", "AELorentz4D", ",", "BELorentz4D", 
   ",", "LNorm", ",", "LNorm2", ",", "EFace3D", ",", "sps", ",", "Bivector"}],
   "}"}]], "Output",
 CellChangeTimes->{
  3.826535155515338*^9, 3.826535296993874*^9, {3.8265353388946037`*^9, 
   3.8265353584460373`*^9}, 3.826535418363462*^9, 3.8271303374187317`*^9, 
   3.8271306711318407`*^9, 3.827132692844314*^9, 3.827288156585715*^9, 
   3.8274047228066125`*^9, 3.827409659214924*^9, 3.827409696556615*^9, 
   3.8274381483300915`*^9, 3.827438213434514*^9, 3.827489609278414*^9, 
   3.8274905260985727`*^9, 3.8274909269108396`*^9, 3.827559950745661*^9, 
   3.827560612939005*^9, 3.8275625934589987`*^9, {3.8277078797609277`*^9, 
   3.8277078836349916`*^9}, {3.827750745641201*^9, 3.8277507685467014`*^9}, 
   3.8336271714469543`*^9},
 CellLabel->
  "Out[713]=",ExpressionUUID->"9883e41b-a43c-42aa-8d31-1cfcab53f765"]
}, Open  ]]
},
WindowSize->{1904, 997},
WindowMargins->{{311, Automatic}, {Automatic, 123}},
Magnification:>0.9 Inherited,
FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (2019\:5e744\:67088\
\:65e5)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 7516, 204, 171, "Input",ExpressionUUID->"92ed2f1f-f96f-4621-b354-885339e7b022"],
Cell[8077, 226, 207, 5, 26, "Input",ExpressionUUID->"67bf5be3-1074-40f1-a750-dc09bdecd627"],
Cell[8287, 233, 1046, 27, 99, "Input",ExpressionUUID->"d586989c-c234-414f-b5dd-ff5ed5aa637a"],
Cell[9336, 262, 1244, 34, 117, "Input",ExpressionUUID->"9f007a70-0459-4b0f-a0e8-76acbcba93a2"],
Cell[10583, 298, 7027, 191, 567, "Input",ExpressionUUID->"9de548ad-a7ec-4fc9-82a8-d0d97ba8c7b1"],
Cell[17613, 491, 4346, 126, 225, "Input",ExpressionUUID->"fbba3e60-f6f5-4d4b-b0cb-fc4ccf41e556"],
Cell[21962, 619, 7607, 207, 320, "Input",ExpressionUUID->"d66750fd-297b-4203-826b-a7ab928130d5"],
Cell[CellGroupData[{
Cell[29594, 830, 795, 15, 26, "Input",ExpressionUUID->"d867a175-059e-44a3-9e3f-f47df7663b6b"],
Cell[30392, 847, 935, 17, 86, "Output",ExpressionUUID->"9883e41b-a43c-42aa-8d31-1cfcab53f765"]
}, Open  ]]
}
]
*)

